exports.postOrdersSchema = {
    summary: "新建宠物订单",
    tags: ["Orders"],
    body: {
        type: 'object',
        required: ['id', 'shipDate'],
        properties: {
            id: {
                type: 'string',
                description: "宠物ID"
            },
            shipDate: {
                type: 'string',
                description: "配送日期",
            },
        }
    }
}

exports.getOrdersSchema = {
    summary: "宠物订单列表",
    tags: ["Orders"],
    querystring: {
        type: 'object',
        properties: {
            page: { type: 'integer', description: '页码' },
            pageSize: { type: 'integer', description: '每页条目数' },
            shipDate: {
                type: 'string',
                description: '配送日期'
            },
            completed: {
                type: 'boolean',
                description: '订单状态'
            },
            status: {
                type: 'string',
                enum: ['available', 'pending', 'sold'],
                description: "商品状态枚举值。合法值包括：\n1. 'available' - 商品可用，表示商品库存充足，可正常购买。\n2. 'pending' - 商品待定，可能表示商品正在等待审核、打包、运输等流程中。\n3. 'sold' - 商品已售，表示该商品已经被购买，目前无库存可供出售。",
            }
        }
    },
}

exports.getOrdersDetailSchema = {
    summary: "查询订单",
    tags: ["Orders"],
    params: {
        type: 'object',
        properties: {
            orderId: { type: 'string', description: '订单ID' }
        }
    },
}

exports.deleteOrdersSchema = {
    summary: "删除宠物订单",
    tags: ["Orders"],
    params: {
        type: 'object',
        properties: {
            orderId: { type: 'string', description: '订单ID' }
        }
    },
}

exports.getOrdersbyPetIdSchema = {
    summary: "通过宠物ID查询订单",
    tags: ["Orders"],
    params: {
        type: 'object',
        properties: {
            petId: { type: 'string', description: '宠物ID' }
        }
    },
}